<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>DeathGhost-产品分类列表</title>
<meta name="keywords" content="DeathGhost,DeathGhost.cn,web前端设,移动WebApp开发" />
<meta name="description" content="DeathGhost.cn::H5 WEB前端设计开发!" />
<meta name="author" content="DeathGhost"/>
<link href="style/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/public.js"></script>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/jqpublic.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/js/jquery-3.1.1.min.js"></script>
<!--
Author: DeathGhost
Author URI: http://www.deathghost.cn
-->
</head>
<body>
<header>
 <section class="Topmenubg">
  <div class="Topnav">
   <div class="LeftNav">
    <a href="<%=path %>/login/toRegister">注册</a>/<a href="<%=path %>/login/toLogin">登录</a>&nbsp;&nbsp;<a href="<%=path %>/shop/selectShop">首页</a>
   </div>
   <div class="RightNav">
    <a href="<%=path %>/user/toUser">用户中心</a> <a href="user_orderlist.html" target="_blank" title="我的订单">我的订单</a> <a href="cart.html">购物车（0）</a> <a href="user_favorites.html" target="_blank" title="我的收藏">我的收藏</a> <a href="<%=path %>/login/toRegisterBuss">商家入驻</a>
   </div>
  </div>
 </section>
 <div class="Logo_search">
  <div class="Logo">
   <img src="images/logo.jpg" title="DeathGhost" alt="模板">
   <i></i>
  </div>
  <div class="Search"> 
   <form method="get" id=form1 action="shop/selectShop">
   <div class="Search_area"> 
   <input type="text" id="foodName" name="foodName" placeholder="请输入您所需查找的商品名称..." class="searchbox" value="${foodName }"/>
   <input type="hidden" id="curPage" name="curPage" value="1">
   <input type="submit" class="searchbutton" value="搜 索" />
   </div>
   </form>
  </div>
 </div>
 <nav class="menu_bg">
  <ul class="menu">
   <li><a href="index.html">首页</a></li>
   <li><a href="list.html">订餐</a></li>
   <li><a href="category.html">积分商城</a></li>
   <li><a href="article_read.html">关于我们</a></li>
  </ul>
 </nav>
</header>
<!--Start content-->
<section class="Psection">
 <section class="fslist_navtree">
  <ul class="select">
		<li class="select-list">
			<dl id="select1">
				<dt>分类：</dt>
				<dd class="select-all selected"><a href="shop/selectShop?typeId=0">全部</a></dd>
				 <c:forEach var="type" items="${type}">
				<dd><a href="shop/selectShop?typeId=${type.typeId}">${type.typeName}</a></dd>
                </c:forEach>
			</dl>
		</li>
	</ul>
 </section>
 <section class="CateL Overflow">
  <c:forEach items="${page.date}" var="food" varStatus="status">
	  <ul>
	   <li> 
		   <a href="shop/selectShopById?foodId=${food.foodId}" target="_blank" title="${food.foodName}">
		   <img src="bussiness/show?foodPicture=${food.foodPicture}" style="width: 300px;height: 230px">
		   <p class="Overflow">${food.foodName}</p>
		   <p class="Overflow">${food.bussinessName}</p>
		   <p class="Overflow">地址：${food.bussinessAddress}</p>
		   </a>
	   </li>
	  </ul>
  </c:forEach>
  	<div class="TurnPage">
        <c:if test="${page.curPage == 1}"><span class="Prev"><i></i>首页</span></c:if>
		<c:if test="${page.curPage > 1}">
			<a href="javascript:jump(1)"><span class="Prev"><i></i>首页</span></a>
		</c:if>
		<c:if test="${page.curPage == 1 }"><span class="PNumber">上一页</span></c:if>
		<c:if test="${page.curPage > 1 }">
				<a href="javascript:jump(${page.curPage-1 })"><span class="PNumber">上一页</span></a>
		</c:if>
			<c:if test="${page.curPage == page.totalPage }"><span class="PNumber">下一页</span></c:if>
			<c:if test="${page.curPage < page.totalPage }">
				<a href="javascript:jump(${page.curPage+1 })"><span class="PNumber">下一页</span></a>
			</c:if>
			<c:if test="${page.curPage == page.totalPage }"><span class="Next">末页<i></i></span></c:if>
			<c:if test="${page.curPage < page.totalPage }">
				<a href="javascript:jump(${page.totalPage })"><span class="Next">末页<i></i></span></a>
			</c:if>
		共${page.totalPage }页 当前页${page.curPage } 总共${page.rows }条数据
    </div>
 </section>
</section>
	<script type="text/javascript">
		//分页查询
		function jump(curPage) {
			$("#curPage").val(curPage);//修改隐藏域的页码
			//还可以进行 form的 提交的url
			//$("#form1").action = "${pageContext.request.contextPath }/user";
			//提交form表单
			$("#form1").submit();
		}
	</script>
</body>
</html>